package client.components;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class PlansManagerView extends SimplePanel {
	private PlansTable table;
	VerticalPanel verticalPanel = new VerticalPanel();

	public PlansManagerView() {
		table = new PlansTable();
		verticalPanel.add(table);
		verticalPanel.add(createAddButton());
		add(verticalPanel);
	}

	private Button createAddButton() {
		final Button button = new Button("Create new Plan");
		button.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				final NewPlanDialogBox db = new NewPlanDialogBox();
				db.show();
			}
		});
		return button;
	}
}
